package com.lznb.cloud.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;


/**
 * 广告
 *
 * @author mzy
 * @email 1992lcg@163.com
 * @date ${datetime}
 */
@Entity
@Table(name = "NEWS_ADVERTISEMENT")
public class NewsAdvertisement implements Serializable {
    private static final long serialVersionUID = 1L;

    //广告ID
    @Id
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid")
    private String advertisementId;

    //后台允许该广告发布者的ID
    @ManyToOne(cascade=CascadeType.REFRESH)
    @JoinColumn(name = "creator_id")
    private Tcommaccount tcommaccount;

    //广告图片
    private String advertisementImg;

    //广告超链接
    private String advertisementUrl;

    //点击量
    private Integer clicksCount;

    //创建时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    //更新时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;


    /**
     * 设置：广告ID
     */
    public void setAdvertisementId(String advertisementId) {
        this.advertisementId = advertisementId;
    }

    /**
     * 获取：广告ID
     */
    public String getAdvertisementId() {
        return advertisementId;
    }

    public Tcommaccount getTcommaccount() {
        return tcommaccount;
    }

    public void setTcommaccount(Tcommaccount tcommaccount) {
        this.tcommaccount = tcommaccount;
    }

    /**
     * 设置：广告图片
     */
    public void setAdvertisementImg(String advertisementImg) {
        this.advertisementImg = advertisementImg;
    }

    /**
     * 获取：广告图片
     */
    public String getAdvertisementImg() {
        return advertisementImg;
    }

    /**
     * 设置：广告超链接
     */
    public void setAdvertisementUrl(String advertisementUrl) {
        this.advertisementUrl = advertisementUrl;
    }

    /**
     * 获取：广告超链接
     */
    public String getAdvertisementUrl() {
        return advertisementUrl;
    }

    /**
     * 设置：点击量
     */
    public void setClicksCount(Integer clicksCount) {
        this.clicksCount = clicksCount;
    }

    /**
     * 获取：点击量
     */
    public Integer getClicksCount() {
        return clicksCount;
    }

    /**
     * 设置：创建时间
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * 获取：创建时间
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 设置：更新时间
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    /**
     * 获取：更新时间
     */
    public Date getUpdateTime() {
        return updateTime;
    }
}
